<style type="text/css">
    .btn.btn-danger-o {
        background: transparent;
    color: {{main.syscolor || '#7c1cc9'}};
    border: 1px solid {{main.syscolor || '#7c1cc9'}};
    }
</style>
<div class="fui-page fui-page-current page-goods-list" style="background: {{main.syscolor || '#7c1cc9'}};">
    <div class='fui-content' style="top:0;background:none;padding-bottom:0">
        <div style="padding:2rem;margin-top:1rem">
            <div class="top" style="margin-bottom:-1.3rem;z-index:108">
                <div class="c">
                    <img style="width:3rem;height:3rem;border-radius:100%" src="{{tomedia(pagedata.info.logo) || '../core/resource/images/no-wxapp.png'}}"  />
                </div>
            </div>
            <div class="fui-code" style="background: linear-gradient(#fdf5d8, #fcd7f7);border-radius: 0.5rem;padding-bottom:1rem">
                <div class="fui-line-title" style="padding-top:1.3rem">
                    <div class="bold">{{pagedata.info.name}}</div>
                    <div style="color:#999;font-size:0.7rem" href="tel:{{pagedata.info.mobile}}">防伪电话：{{pagedata.info.mobile}} <i class="icon icon-phone" style="font-size:0.6rem"></i></div>
                    <div style="color:#999;font-size:0.7rem" href="javascript:;" ng-click="pagedata.openLocation();">地址：{{pagedata.info.address}} <i class="icon icon-map" style="font-size:0.6rem"></i></div>
                </div>
                <div class="c">
                    <div ng-if="pagedata.info.count>0" style="margin-left:auto;margin-right:auto;padding:0.5rem;">
                        <span style="color:#999;font-size:0.8rem">查询次数：{{pagedata.info.count}}</span>
                    </div>
                    <div ng-if="pagedata.message.error!=1 && pagedata.message.error!=0" style="margin-left:auto;margin-right:auto;padding:0.5rem;border-radius:0.2rem;line-height: 1">
                        <i  class="icon icon-erweima" style="font-size:8rem;color:#999;border-radius:0.5rem"></i>
                    </div>
                    <div ng-if="pagedata.message.error==1 || pagedata.message.error==0" style="margin-left:auto;margin-right:auto;padding:0.5rem;border-radius:0.2rem;">
                        <div ng-if="pagedata.message.error == 1"><i class="icon jinyunicon icon-cry" style="font-size:3rem"></i></div>
                        <div ng-if="pagedata.message.error == 0"><i class="icon jinyunicon icon-success" style="font-size:3rem;color:#f60"></i></div>
                    </div>
                    <div class="subtitle" style="color: #f60;font-size:0.4rem"></div>
                </div>
                <div class="fui-line-title" style="padding:0.3rem 1rem">
                    <div class="text text-danger bold" style="color:#fff;">
                        <span style="color:#999;font-size:0.8rem">{{pagedata.message.msg}}</span>
                    </div>
                    <div ng-if="pagedata.info.goods_title" class="text text-danger" style="line-height:1.5">
                        <span style="color:#F60;font-size:13px">扫码结果：{{pagedata.info.goods_title}}</span>
                    </div>
                    <div class="text text-danger" style="margin-bottom: -8px;color:#fff;line-height:1.5">
                        <span style="color:#999;font-size:13px">{{pagedata.info.content}}</span>
                    </div>
                </div>
                <div class="content-empty" style="margin-top:0.5rem;">
                    <a href="javascript:;" ng-click="pagedata.scancode()" class='btn btn-sm btn-danger-o external' style="border-radius: 100px;width:  9rem;font-size: .75rem">
                        <i class="icon jinyunicon icon-saoyisao1" style="font-size:0.75rem;"></i>
                        请点击扫码，查防伪！
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="fe-mod-9" style="height:7rem;min-height:6rem">
    <img style="height:6rem" ng-src="{{tomedia(pagedata.hdps.picurl) || '../core/resource/images/nopic.jpg'}}">
</div>
<script language="javascript">
scope.pagedata.scancode=function () {
			console.log('scanQRCodeOK');
			wx.scanQRCode({
				needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
					var start = result.indexOf(',');
					result = result.substr(start+1);
					if(result.indexOf("http") != -1){
                        var url=result;
                    }else{
                        var url=scope.pagedata.url+"&code="+result
                    }
					location.href = url;
				}
			});
}
scope.pagedata.openLocation=function(item){
    wx.openLocation({
        latitude: '', // 纬度，浮点数，范围为90 ~ -90
        longitude:'', // 经度，浮点数，范围为180 ~ -180。
        name: scope.pagedata.info.name, // 位置名
        address: scope.pagedata.info.address, // 地址详情说明
        scale: 20, // 地图缩放级别,整形值,范围从1~28。默认为最大
        infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
        success:function(){
            //alert(1111);
        }
    });
}
</script> 